<?php
use mdm\admin\components\MenuHelper;
use dmstr\widgets\Menu;
?>
<aside class="main-sidebar">

    <section class="sidebar">



        <!-- search form -->
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text"  name="q" class="form-control menu-search" placeholder="<?=Yii::t('common','Search Menu...')?>"/>
                <span class="input-group-btn">
                    <a src="javascript:;" name='search' id='search-btn' class="btn btn-flat">
                        <i class="fa fa-search"></i>
                    </a>
                </span>
            </div>
        </form>
        <!-- /.search form -->

        <?=
        Menu::widget(
                [
                    'options' => ['class' => 'sidebar-menu tree', 'data-widget' => 'tree'],
                    'items' => [
                        ['label' => 'Menu Yii2', 'options' => ['class' => 'header']],
                        ['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii']],
                        ['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug']],
                        ['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest],
                    ]
                ]
        )
        ?>
        <?=
        Menu::widget([
            'options' => ['class' => 'sidebar-menu tree', 'data-widget' => 'tree'],
            'items' => MenuHelper::getAssignedMenu(Yii::$app->user->id)
        ]);
        ?>
    </section>

</aside>
